package com.enation.app.web.core.action.backend;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.enation.app.base.core.model.PluginDataMapper;
import com.enation.app.web.core.plugin.homepage.HomePagePluginBundle;

/**
 * 
 * @function 首页设置控制器
 * @author 闯哥
 * @time 2016年10月19日 上午9:38:06
 */
@Controller
@RequestMapping("/core/admin")
@SuppressWarnings("serial")
public class HomePageController {

	@Autowired
	private HomePagePluginBundle homePagePluginBundle;

	@RequestMapping(value = "/homePageSetting")
	public ModelAndView homePageSetting() {
		ModelAndView view = new ModelAndView();

		List<PluginDataMapper> tabTitleList = this.homePagePluginBundle
				.getTabList();
		List<PluginDataMapper> tabHtmlList = this.homePagePluginBundle
				.getDetailHtml();

		view.addObject("tabs", tabTitleList);
		view.addObject("htmls", tabHtmlList);
		view.setViewName("/core/admin/homepage/input");

		return view;
	}
}
